# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
_name=python-openzwave
pkgname=py3-openzwave
pkgver=0.4.19
pkgrel=4
pkgdesc="Python wrapper for openzwave"
url="http://www.openzwave.com/"
arch="all"
license="GPL"
depends=" $pkgname-lib $pkgname-api $pkgname-manager"
_libdeps="py3-six"
_apideps="py3-pydispatcher"
_managerdeps="py3-urwid"
makedepends="python3-dev linux-headers eudev-dev coreutils py3-setuptools cython
	$_libdeps $_apideps $_managerdeps"
install=""
subpackages="$pkgname-lib $pkgname-api::noarch $pkgname-manager::noarch"
source="$_name-$pkgver.tar.gz::https://github.com/OpenZWave/python-openzwave/archive/v$pkgver.tar.gz"
builddir="$srcdir/python-openzwave-$pkgver"


build() {
	cd "$builddir"
	unset CFLAGS CPPFLAGS
	case "$CARCH" in
		ppc64le) export CPPFLAGS="-Wno-error";;
	esac
	make build PYTHON_EXEC=python3
	python3 setup-lib.py build
	python3 setup-api.py build
	python3 setup-manager.py build
}

package() {
	mkdir -p "$pkgdir"
}

lib() {
	pkgdesc="$pkgdesc (lib)"
	depends="python3 $_libdeps"
	cd "$builddir"
	python3 setup-lib.py install \
		--single-version-externally-managed --root ${subpkgdir}
}


api() {
	pkgdesc="$pkgdesc (api)"
	depends="python3 $_apideps"
	cd "$builddir"
	python3 setup-api.py install \
		--single-version-externally-managed --root "$subpkgdir"
}

manager() {
	pkgdesc="$pkgdesc (manager)"
	depends="python3 $_managerdeps"
	cd "$builddir"
	python3 setup-manager.py install \
		--single-version-externally-managed --root "$subpkgdir"
}


sha512sums="153e7571ee445c3af1b5880097ba484657e4c1aa376ae7d3c46b58fc485087742ecd04dba4c1ffba97b2f3b64b4e055cabfed573a457857f9d75e3b6ad12194b  python-openzwave-0.4.19.tar.gz"
